package com.foucus.myfouces.Resource.Util;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.foucus.myfouces.R;

import retrofit2.Call;

/**
 * Created by yf-06 on 2017/6/30.
 */

public class GliderUtil {
    private Context mContext;

    public void allGlider(Context mContext, String url, ImageView img) {
        Glide.with(mContext)
                .load(url) //加载图片地址
//                .asBitmap()  //指定图片格式为静态
//                .asGif() //指定图片格式为静态，GIF
                .placeholder(R.mipmap.ic_launcher) //加载前占位图
                .error(R.mipmap.ic_launcher) //异常占位图
                .diskCacheStrategy(DiskCacheStrategy.NONE) //禁言Glide缓存功能
                .override(100, 100) //将图片修改为指定大小
                .into(img); //指定控件
    }

    public static void bannerGlider(Context mContext, String url, ImageView img) {
        Glide.with(mContext)
                .load(url)
                .placeholder(R.mipmap.ic_launcher)
                .into(img);

    }

    public static void Glider1() {

    }

    public static void Glider2() {

    }
}
